Skip to content

fix(ui): reload access rule lists when the tab is opened - #1261

Open
driin0 wants to merge 1 commit into
tobychui:v3.3.4from
driin0:fix/access-tab-refresh
Open

fix(ui): reload access rule lists when the tab is opened#1261
driin0 wants to merge 1 commit into
tobychui:v3.3.4from
driin0:fix/access-tab-refresh

Conversation

@driin0

@driin0 driin0 commented Aug 12, 2026

Copy link
Copy Markdown

What happens

Open Access Control, switch to another tab, come back: the black/whitelist tables still show what they showed the first time. Only a full page reload updates them.

Why

initBlackWhitelistTables() is called from two places in access.html — when the component first renders, and from handleSelectedAccessRuleChange(). Nothing runs it when the tab is re-opened, so anything that changed the lists in between is invisible.

This shows up whenever the lists are changed outside that page: a second admin session, or a plugin keeping a whitelist in sync. In my case the entries are IPs resolved from DDNS names, so they move on their own every few minutes and the page is almost always out of date.

The change

index.html already provides tabSwitchEventBind, and status, httprp, vdir, rules, setroot, streamproxy and pluginContextWindow all register there. This adds access alongside them. No new mechanism.

Tested

Zoraxy 3.3.3 in Docker (arm64) running with -dev against this branch's src/web: changed a whitelisted IP from outside the page, switched to Status and back, the table showed the new value without a reload. Verified the same sequence still shows the stale value on an unpatched build.

The black/whitelists are fetched only when the access component is first
rendered, or when another rule is picked from the dropdown. Anything that
changes them in between - a second session, or a plugin syncing resolved
IPs into a whitelist - stays invisible until the whole page is reloaded.

index.html already provides tabSwitchEventBind for exactly this, and seven
other tabs use it. This registers access alongside them.
@driin0
driin0 requested a review from tobychui as a code owner August 12, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant